home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_200 / 295_01 / bputb.c < prev    next >
Text File  |  1989-12-28  |  1KB  |  51 lines

  1. /*    Copyright (c) 1989 Citadel    */
  2. /*       All Rights Reserved        */
  3.  
  4. /* #ident    "bputb.c    1.2 - 89/10/31" */
  5.  
  6. /*#include <stddef.h>*/
  7. #include "blkio_.h"
  8.  
  9. /*man---------------------------------------------------------------------------
  10. NAME
  11.      bputb - put a block into a block file
  12.  
  13. SYNOPSIS
  14.      #include <blkio.h>
  15.  
  16.      int bputb(bp, bn, buf)
  17.      BLKFILE *bp;
  18.      bpos_t bn;
  19.      const void *buf;
  20.  
  21. DESCRIPTION
  22.      The bputb function writes the block pointed to by buf into block
  23.      number bn of the block file associated with BLKFILE pointer bp.
  24.      buf must point to a storage area at least as large as the block
  25.      size for bp.
  26.  
  27.      bputb will fail if one or more of the following is true:
  28.  
  29.      [EINVAL]       bp is not a valid BLKFILE pointer.
  30.      [EINVAL]       bn is less than 1.
  31.      [EINVAL]       buf is the NULL pointer.
  32.      [BEEOF]        There are fewer than bn - 1 blocks in
  33.                     the file.
  34.      [BENOPEN]      bp is not open for writing.
  35.  
  36. SEE ALSO
  37.      bgetb, bputbf, bputh.
  38.  
  39. DIAGNOSTICS
  40.      Upon successful completion, a value of 0 is returned.  Otherwise,
  41.      a value of -1 is returned, and errno set to indicate the error.
  42.  
  43. ------------------------------------------------------------------------------*/
  44. int bputb(bp, bn, buf)
  45. BLKFILE *bp;
  46. bpos_t bn;
  47. CONST void *buf;
  48. {
  49.     return bputbf(bp, bn, (size_t)0, buf, bp->blksize);
  50. }
  51.